import request from '@/utils/request'

// GET   info    /admin/acl/index/info
// POST  login   /admin/acl/index/login
// POST  logout  /admin/acl/index/logout
interface loginModel {
  username:string,
  password:string,
}
export interface userModel{
  token:string,
}
export interface userInfoModel {
  avatar: string,
  name: string,
  buttons: string[],
  roles: string[],
  routes: string[]
}
export default {
  //登录
  login(data:loginModel){
    return request.post<any,userModel>(`/admin/acl/index/login`,data);
  },
  //获取个人信息
  getInfo(){
    return request.get<any,userInfoModel>(`/admin/acl/index/info`)
  },
  //退出登录
  logout(){
    return request.post(`/admin/acl/index/logout`)
  }
}